//
//  WishesModel.m
//  一点互助
//
//  Created by rimi on 16/8/23.
//  Copyright © 2016年 zhangboqiu. All rights reserved.
//

#import "WishesModel.h"
#import <objc/runtime.h>
@implementation WishesModel
+(NSArray *)modelArrayWithDictionaryArr:(NSArray *)dictionaryArry{
    NSMutableArray *arr = [NSMutableArray array];
    for (NSDictionary *mutableDic in dictionaryArry) {
        WishesModel *model = [[WishesModel alloc]init];
        model.wishId = [mutableDic[@"wish_id"]integerValue];
        model.wishDesc = mutableDic[@"wish_desc"];
        model.price = [mutableDic[@"wish_price"]integerValue];
        model.title = mutableDic[@"wish_title"];
        model.userId = [mutableDic[@"user_id"]integerValue];
        model.avatar = mutableDic[@"avatar"];
        model.city = mutableDic[@"city"];
        model.province = mutableDic[@"province"];
        model.userNiceName = mutableDic[@"user_nicename"];
        model.withCat = [mutableDic[@"wish_cat"]integerValue];
        model.wishEndTime = mutableDic[@"wish_end_time"];
        model.wishRewardNum = [mutableDic[@"wish_reward_num"]integerValue];
        model.wishType = [mutableDic[@"wish_type"]integerValue];
        model.wishAddTime = mutableDic[@"wish_add_time"];
        model.isFavorites = [mutableDic[@"is_favorites"]boolValue];
        model.wishRewardPrice = [mutableDic[@"wish_reward_price"]integerValue];
        model.mobile = [mutableDic[@"mobile"]integerValue];
        NSArray *photoArr = mutableDic[@"photo"];
        NSMutableArray *photoarr = [NSMutableArray array];
        for (int i = 0; i <photoArr.count ; i++) {
            for (NSDictionary *dic in photoArr) {
                NSString *str = dic[@"pic_url"];
                [photoarr addObject:str];
            }
        }
        model.photoArray = photoarr;
        [arr addObject:model];
    }
    return arr;
}
@end
